package org.easymodelers.gmf.creator.impl;

import java.io.IOException;
import java.util.List;

import org.easymodelers.gmf.creator.GmfToolCreator;
import org.easymodelers.gmf.utils.ModelsManager;
import org.easymodelers.modeler.data.ModelerDefinition;
import org.easymodelers.processing.ModelerUpdate;
import org.eclipse.gmf.tooldef.GMFToolFactory;
import org.eclipse.gmf.tooldef.ToolRegistry;

public class GenericGmfToolCreator extends AbstractGenericGmfCreator<ToolRegistry> implements GmfToolCreator {

	protected ModelsManager createModelsManager(String modelPath) {
		ToolRegistry toolRegistry = GMFToolFactory.eINSTANCE.createToolRegistry();
		return new ModelsManager(toolRegistry);
	}

	protected ToolRegistry getRootEObject(ModelsManager modelsManager) {
		return modelsManager.getToolRegistry();
	}

	public void registerDefaultElementDefinitionHandlers() {
	}

	public List<ModelerUpdate> createGmfTool(String modelPath, ModelerDefinition modeler) throws IOException {
		return createGmfModel(modelPath, modeler);
	}
}
